package com.miaostars.level.listener;

import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDeathEvent;
import com.miaostars.level.manager.PlayerDataManager;

public class CombatListener implements Listener {
    private final PlayerDataManager dataManager;

    public CombatListener(PlayerDataManager dataManager) {
        this.dataManager = dataManager;
    }

    @EventHandler
    public void onKill(EntityDeathEvent e) {
        if (e.getEntity().getKiller() != null) {
            UUID uuid = e.getEntity().getKiller().getUniqueId();
            dataManager.addKill(uuid);
        }
    }
}